package com.stox.design;

import java.util.Comparator;

public interface Ordered {

	public static class OrderComparator implements Comparator<Ordered>{
		
		public static final OrderComparator instance = new OrderComparator();
		
		@Override
		public int compare(Ordered one, Ordered two) {
			if(one == null) return 1;
			if(two == null) return -1;
			if(one.getOrder() == two.getOrder()) return 0; 
			return one.getOrder() < two.getOrder()? -1:1;
		}
	}
	
	public int getOrder();
	
}
